from rest_framework import serializers
from .models import FlowNode, FlowEdge

class FlowNodeSerializer(serializers.ModelSerializer):
    class Meta:
        model = FlowNode
        fields = ['node_id', 'type', 'position_x', 'position_y', 'data']

class FlowEdgeSerializer(serializers.ModelSerializer):
    class Meta:
        model = FlowEdge
        fields = ['edge_id','source', 'target','source_handle', 'target_handle']